import { MockMethod } from 'vite-plugin-mock';
import Mock, { Random } from 'mockjs';

// 学员信息接口
const data = [];
const filterMap = {
  1: '长期班',
  2: '短期班'
};
const enumMap = {
  1: '未发布',
  2: '修订中',
  3: '提交了',
  4: '已完成'
};
for (let i = 0; i < 10; i += 1) {
  const classInfo = Math.ceil(Math.random() * 2);
  const sortEnum = Math.ceil(Math.random() * 4);
  data.push(
    Mock.mock({
      stu_id: i,
      'two|1-100': 1,
      three: Mock.mock('@csentence(3, 5)'),
      four: Mock.mock('@csentence(3, 5)'),
      five: Mock.mock('@csentence(3, 5)'),
      five_id: i,
      six: Mock.mock('@csentence(3, 5)'),
      six_id: i,
      seven: filterMap[classInfo],
      seven_id: classInfo,
      'eight|1-100': 1,
      nine: parseInt(Number(Random.date('T')) / 1000),
      'ten|1-100': 1,
      eleven: enumMap[sortEnum],
      eleven_id: sortEnum
    })
  );
}
export default [
  {
    url: '/haichuan/api/getModFieldsInfo',
    method: 'get',
    response: () => {
      return {
        code: 0,
        msg: '请求成功',
        data: [
          // 普通的 主键 基础信息
          {
            id: 0,
            field_id: '10003001000024',
            dim_id: 3001,
            data_len: 11,
            data_type: 1,
            field_type: 2,
            field_name: 'stu_id',
            field_title: '第一个1',
            is_primary: 1,
            default: '0',
            table_id: 10002,
            status: 1,
            sort: 1,
            frontend_field_desc: '课堂巩固订正次数',
            reflection: '',
            enum: '',
            reflections: null,
            enums: null,
            frontend_field_type: 0,
            frontend_sort_rule: 0,
            frontend_search_rule: 0,
            frontend_filter_rule: 0,
            frontend_multi_filter_enum: '',
            frontend_interact: 0,
            frontend_field_genre: 0,
            frontend_field_show_genre: 2,
            frontend_field_title: '',
            created: 0,
            updated: 0
          },
          // 基础信息 数字排序
          {
            id: 0,
            field_id: '10003001000024',
            dim_id: 3001,
            data_len: 11,
            data_type: 1,
            field_type: 1,
            field_name: 'two',
            field_title: '第2个2',
            is_primary: 0,
            default: '0',
            table_id: 10002,
            status: 1,
            sort: 3,
            field_desc: '',
            reflection: '',
            enum: '',
            reflections: null,
            enums: null,
            frontend_field_type: 0,
            frontend_sort_rule: 1,
            frontend_search_rule: 0,
            frontend_filter_rule: 0,
            frontend_multi_filter_enum: '',
            frontend_interact: 0,
            frontend_field_desc: '',
            frontend_field_genre: 0,
            frontend_field_show_genre: 0,
            frontend_field_title: '',
            created: 0,
            updated: 0
          },
          // 基础信息  字母排序
          {
            id: 0,
            field_id: '10003001000024',
            dim_id: 3001,
            data_len: 11,
            data_type: 1,
            field_type: 1,
            field_name: 'three',
            field_title: '第三个',
            is_primary: 0,
            default: '0',
            table_id: 10002,
            status: 1,
            sort: 2,
            field_desc: '课堂巩固订正次数',
            reflection: '',
            enum: '',
            reflections: null,
            enums: null,
            frontend_field_type: 0,
            frontend_sort_rule: 2,
            frontend_search_rule: 0,
            frontend_filter_rule: 0,
            frontend_multi_filter_enum: '',
            frontend_interact: 0,
            frontend_field_desc: '',
            frontend_field_genre: 0,
            frontend_field_show_genre: 0,
            frontend_field_title: '',
            created: 0,
            updated: 0
          },
          // 备注信息 字母大小排序
          {
            id: 0,
            field_id: '10003001000024',
            dim_id: 3001,
            data_len: 11,
            data_type: 2,
            field_type: 1,
            field_name: 'four',
            field_title: '第4个',
            is_primary: 0,
            default: '0',
            table_id: 10002,
            status: 1,
            sort: 5,
            field_desc: '',
            reflection: '',
            enum: '',
            reflections: null,
            enums: null,
            frontend_field_type: 0,
            frontend_sort_rule: 2,
            frontend_search_rule: 0,
            frontend_filter_rule: 0,
            frontend_multi_filter_enum: '',
            frontend_interact: 0,
            frontend_field_desc: '',
            frontend_field_genre: 1,
            frontend_field_show_genre: 0,
            frontend_field_title: '',
            created: 0,
            updated: 0
          },
          // 作业提交状态排序  备注信息 支持搜索
          {
            id: 0,
            field_id: '10003001000024',
            dim_id: 3001,
            data_len: 11,
            data_type: 1,
            field_type: 2,
            field_name: 'five',
            field_title: '第五个',
            is_primary: 0,
            default: '0',
            table_id: 10002,
            status: 1,
            sort: 4,
            reflection: '',
            enum: '',
            reflections: null,
            enums: null,
            frontend_field_type: 0,
            frontend_sort_rule: 2,
            frontend_search_rule: 1,
            frontend_filter_rule: 0,
            frontend_multi_filter_enum: '',
            frontend_interact: 0,
            frontend_field_desc: '',
            frontend_field_genre: 1,
            frontend_field_show_genre: 2,
            frontend_field_title: '',
            created: 0,
            updated: 0
          },
          // 备注信息，支持搜索
          {
            id: 0,
            field_id: '10003001000024',
            dim_id: 3001,
            data_len: 11,
            data_type: 1,
            field_type: 1,
            field_name: 'six',
            field_title: '第六个',
            is_primary: 0,
            default: '0',
            table_id: 10002,
            status: 1,
            sort: 7,
            reflection: '',
            enum: '',
            reflections: null,
            enums: null,
            frontend_field_type: 0,
            frontend_sort_rule: 0,
            frontend_search_rule: 1,
            frontend_filter_rule: 0,
            frontend_multi_filter_enum: '',
            frontend_interact: 0,
            frontend_field_desc: '',
            frontend_field_genre: 1,
            frontend_field_show_genre: 0,
            frontend_field_title: '',
            created: 0,
            updated: 0
          },
          // 续报信息 多项筛选
          {
            id: 0,
            field_id: '10003001000024',
            dim_id: 3001,
            data_len: 11,
            data_type: 1,
            field_type: 2,
            field_name: 'seven',
            field_title: '第七个',
            is_primary: 0,
            default: '0',
            table_id: 10002,
            status: 1,
            sort: 9,
            reflection: '',
            enum: '',
            reflections: filterMap,
            enums: null,
            frontend_field_type: 0,
            frontend_sort_rule: 0,
            frontend_search_rule: 0,
            frontend_filter_rule: 4,
            frontend_multi_filter_enum: '',
            frontend_interact: 0,
            frontend_field_desc: '',
            frontend_field_genre: 2,
            frontend_field_show_genre: 3,
            frontend_field_title: '',
            created: 0,
            updated: 0
          },
          // 续报信息 区间筛选
          {
            id: 0,
            field_id: '10003001000024',
            dim_id: 3001,
            data_len: 11,
            data_type: 1,
            field_type: 2,
            field_name: 'eight',
            field_title: '第八个',
            is_primary: 0,
            default: '0',
            table_id: 10002,
            status: 1,
            sort: 8,
            reflection: '',
            enum: '',
            enums: null,
            frontend_field_type: 0,
            frontend_sort_rule: 0,
            frontend_search_rule: 0,
            frontend_filter_rule: 1,
            frontend_multi_filter_enum: '',
            frontend_interact: 0,
            frontend_field_desc: '',
            frontend_field_genre: 2,
            frontend_field_show_genre: 0,
            frontend_field_title: '',
            created: 0,
            updated: 0
          },
          // 续报信息  区间筛选-日期
          {
            id: 0,
            field_id: '10003001000024',
            dim_id: 3001,
            data_len: 11,
            data_type: 1,
            field_type: 1,
            field_name: 'nine',
            field_title: '第九个',
            is_primary: 0,
            default: '0',
            table_id: 10002,
            status: 1,
            sort: 6,
            reflection: '',
            enum: '',
            enums: null,
            frontend_field_type: 0,
            frontend_sort_rule: 0,
            frontend_search_rule: 0,
            frontend_filter_rule: 2,
            frontend_multi_filter_enum: '',
            frontend_interact: 0,
            frontend_field_desc: '',
            frontend_field_genre: 2,
            frontend_field_show_genre: 7,
            frontend_field_title: '',
            created: 0,
            updated: 0
          },
          // 续报信息 区间筛选 百分比 排序
          {
            id: 0,
            field_id: '10003001000024',
            dim_id: 3001,
            data_len: 11,
            data_type: 1,
            field_type: 1,
            field_name: 'ten',
            field_title: '第十个',
            is_primary: 0,
            default: '0',
            table_id: 10002,
            status: 1,
            sort: 11,
            reflection: '',
            enum: '',
            enums: null,
            frontend_field_type: 0,
            frontend_sort_rule: 1,
            frontend_search_rule: 0,
            frontend_filter_rule: 3,
            frontend_multi_filter_enum: '',
            frontend_interact: 0,
            frontend_field_desc: '',
            frontend_field_genre: 2,
            frontend_field_show_genre: 6,
            frontend_field_title: '',
            created: 0,
            updated: 0
          },
          // 行课信息 多选
          {
            id: 0,
            field_id: '10003001000024',
            dim_id: 3001,
            data_len: 11,
            data_type: 1,
            field_type: 1,
            field_name: 'eleven',
            field_title: '第十一个',
            is_primary: 0,
            default: '0',
            table_id: 10002,
            status: 1,
            sort: 10,
            reflection: '',
            enums: [1, 2, 3, 4, 5],
            frontend_field_type: 0,
            frontend_sort_rule: 3,
            frontend_search_rule: 0,
            frontend_filter_rule: 3,
            frontend_multi_filter_enum: '',
            frontend_interact: 0,
            frontend_field_desc: '',
            frontend_field_genre: 3,
            frontend_field_show_genre: 0,
            frontend_field_title: '',
            created: 0,
            updated: 0
          },
          // 行课信息 只有提示
          {
            id: 0,
            field_id: '10003001000024',
            dim_id: 3001,
            data_len: 11,
            data_type: 1,
            field_type: 1,
            field_name: 'twelve',
            field_title: '只有提示',
            is_primary: 0,
            default: '0',
            table_id: 10002,
            status: 1,
            sort: 10,
            reflection: '',
            enums: [1, 2, 3, 4, 5],
            frontend_field_type: 0,
            frontend_sort_rule: 0,
            frontend_search_rule: 0,
            frontend_filter_rule: 0,
            frontend_multi_filter_enum: '',
            frontend_interact: 0,
            frontend_field_desc: '只有提示',
            frontend_field_genre: 3,
            frontend_field_show_genre: 0,
            frontend_field_title: '',
            created: 0,
            updated: 0
          }
        ]
      };
    }
  },
  {
    url: '/haichuan/api/getStudentInfo',
    method: 'get',
    response: () => {
      return {
        code: 0,
        msg: '请求成功',
        data
      };
    }
  }
] as MockMethod[];
